﻿using Net5ApiAndEfMySql.DtoModel.Common;
using Net5ApiAndEfMySql.DtoModel.SystemAdmin;
using Net5ApiAndEfMySql.PoModel.SystemAdmin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Net5ApiAndEfMySql.IService.SystemAdmin
{
    public interface IAdminUserService:IBaseService
    {
        AdminUserPo GetAdminUserByUserName(string userName);
        AdminUserDto Login(string userName, string pwd, ClientType clientType, out string mess);
        ResultCode ValidateToken(string token);

        AdminUserDto GetLoginUserByToken(string token);

        PagerResult<AdminUserPo> GetPageList(SearchModel m);

        bool ValidateUserName(string userName);
        /// <summary>
        /// 添加一个用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        bool AdminUserAdd(AdminUserDto user);

        bool AdminUserUpdate(AdminUserDto user);

        AdminUserDto GetAdminUserDtoByUserName(string userName);

        /// <summary>
        /// 退出登录
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        bool LoginOut(string token);
    }
}
